<?php

namespace app\common\validate\user;

use app\common\validate\BaseValidate;

class ArtworkAttribute extends BaseValidate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'artwork_id' => ['require', 'number', '>:0'],
        'mat_key'    => ['require', 'number'],
        'pmat_key'   => ['number'],
        'product_id' => ['require', 'number', '>:0'],
        'position'   => ['require', 'array', 'decimal:10,4'],
        'rotation'   => ['require', 'array', 'decimal:10,4'],
        'proportion' => ['require', 'decimal:10,4'],
    ];

    /**
     * 提示消息
     */
    protected $message = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
//        'add'  => ['artwork_id', 'mat_key', 'pid', 'product_id', 'position', 'rotation', 'proportion'],
//        'edit' => ['artwork_id', 'mat_key', 'pid', 'position', 'rotation', 'proportion'],
//        'del'  => ['artwork_id', 'mat_key'],
        'batch' => ['artwork_id', 'mat_key', 'pid', 'product_id', 'position', 'rotation', 'proportion'],
    ];
}
